//
//  RGCommentViewCell.m
//  RedGrass
//
//  Created by wukong on 2019/1/22.
//  Copyright © 2019年 hongcaosp. All rights reserved.
//

#import "RGCommentViewCell.h"

@interface RGCommentViewCell()

@property (strong, nonatomic) RGCommentContentView *commentContentView;


@end

@implementation RGCommentViewCell

-(instancetype) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
        self.contentView.backgroundColor = [UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self.contentView addSubview:self.commentContentView];
        [_commentContentView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.and.bottom.mas_equalTo(self.contentView).mas_offset(0);
            make.left.mas_equalTo(self.contentView).mas_offset(60);
            make.right.mas_equalTo(self.contentView).mas_offset(0);
        }];
    }
    return self;
}

-(void) setChildCommenModel:(RGChildRecommentListModel *)childCommenModel{
    if(!childCommenModel){
        return;
    }
    _childCommenModel = childCommenModel;
    _commentContentView.childCommenModel = childCommenModel;
}


#pragma mark - getter

-(RGCommentContentView *)commentContentView{
    if(!_commentContentView){
        _commentContentView = [[RGCommentContentView alloc]initWithIsTapEnable:YES];
    }
    AA_WEAK_MAKE(self) weakSelf = self;
    [_commentContentView setActionBtnClickBlock:^(NSInteger tag) {
        if(weakSelf.cellBtnClickBlock){
            weakSelf.cellBtnClickBlock(tag);
        }
    }];
    return _commentContentView;
}


@end
